<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template member/header}

	<input type="hidden" id="hdErrMsg" />
	<div class="main-head">
		<span>用户中心 &gt; 报表管理 &gt; 个人报表</span>
	</div>
	<div class="con_box">
		<form id="form1" action="?" method="get">
			<input type="hidden" name="m" value="{$m}" />
			<input type="hidden" name="c" value="{$c}" />
			<input type="hidden" name="a" value="{$a}" />
			<div class="form-box">
				<span>
					时间：
					<input type="text" id="dtrange" name="dtrange" value="{$dtrange}" class="dtrange" readonly="readonly">
				</span>
				<span><a href="javascript:void(0)" class="btn" data-bind="click:searchData">查询</a></span>
			</div>
		</form>
		<div class="table-list">
			<table>
				<thead>
					<tr>
						<th>日期</th>
						<th>充值</th>
						<th>提现</th>
						<th><font class="fc_red">彩票投注</font></th>
						<th><font class="fc_red">彩票中奖</font></th>
						<th><font class="fc_red">投注返点</font></th>
						<th><font class="fc_red">代理返点</font></th>
						<th><font class="fc_red">彩票盈亏</font></th>
					</tr>
				</thead>
				<tbody>
					{if $data}
						{_ $num = [];}
						{loop $data as $val}
							{_ $num['recharge'] += $val['recharge'];}
							{_ $num['cash'] += $val['cash'];}
							{_ $num['invest'] += $val['invest'];}
							{_ $num['prize'] += $val['prize'];}
							{_ $num['investback'] += $val['investback'];}
							{_ $num['agentback'] += $val['agentback'];}
						<tr>
							<td>{date('Y-m-d',$val['dateline'])}</td>
							<td>{$val['recharge']}</td>
							<td>{$val['cash']}</td>
							<td>{$val['invest']}</td>
							<td>{$val['prize']}</td>
							<td>{$val['investback']}</td>
							<td>{$val['agentback']}</td>
							<td>{_e $val['prize'] - $val['invest']}</td>
						</tr>
						{/loop}
					{else}
						<tr>
							<td colspan="8">请选择查询条件之后进行查询</td>
						</tr>
					{/if}
				</tbody>
				{if $data}
				<tfoot>
					<tr>
						<td>本页小计</td>
						<td>{$num['recharge']}</td>
						<td>{$num['cash']}</td>
						<td>{$num['invest']}</td>
						<td>{$num['prize']}</td>
						<td>{$num['investback']}</td>
						<td>{$num['agentback']}</td>
						<td>{_e $num['prize'] - $num['invest']}</td>
					</tr>
				</tfoot>
				{/if}
			</table>
		</div>
	</div>
	<script src="static/js/TeamReport.js"></script>
	<script src="static/js/laydate/laydate.js"></script>
	<script>
		$().ready(function(){
			laydate.render({
				elem: '#dtrange',
				range: true
			});
		});
	</script>
	
    <div id="SEARCH-TIP" style="display:none;">
        <div class="mask"></div>
        <div class="popup tips-popup">
            <div class="popup-head">
                <span>提示</span>
            </div>
            <div class="popup-body">
                <p>查询中,请您耐心等待.....</p>
            </div>
        </div>
    </div>

{template member/footer}